1. Field of the Invention
The present invention relates to an optical character reader for reading characters, symbols, and so on, on the basis of the scanning of a subject by a portable scanner. In the following, description will be made only as to characters representatively, but the same will apply to symbols etc., in quite the same manner.
2. Description of the Prior Art
POS (Point Of Sales) systems for managing the stock by reference to the sales data accumulated at every commodity have spread among supermarkets, department stores and the like. Portable optical character readers have been generally used in the POS systems.
A typical diagram of this type portable optical character reader is shown in FIG. 1.
In FIG. 1 the reference numeral 1 designates a scanner which is applied onto a subject 3 by hand 2 to thereby read characters recorded on the subject 3. For example, the subject 3 is a price tag used in a POS system. The reference numeral 4 designates a light source, the reference numeral 5 designates a lens series, and the reference numeral 6 designates an image sensor. It is necessary that the range of view of the image sensor 6 is not less than one field in characters recorded on the price tag 3. In FIG. 1 the range of view of the image sensor 6 is established to be one field and several characters long and about three characters high. The term "field" used herein means one record unit on the price tag. For example, one field is composed of one character "C" defined as a function code and ten numeral characters defined as data characters following the function code. The reference numeral 7 designates a controlling and binary encoding circuit in which an analog signal as an output signal of the image sensor 6 is converted to a binary signal used for discrimination between a character region and a back region, so that the binary signal is sent to a scene memory 8.
The reference numerals 9 to 13 designate means for recognizing each character through the scene memory 8.
Almost all binary data contained in the range of view of the image sensor 6 are stored in the scene memory 8. The binary data of the image sensor 6 are explained with reference to FIG. 2(a), in which the image sensor 6 has (p.times.q) pixels when the range for view thereof is expressed in a coordinate system (XY).
Characters, inclusive of symbols, are recognized one by one by the character discrimination circuit 13. It is therefore necessary to take out one-character's data from the scene memory 8. The one-column cut-out circuit 9 serves to take out (m.times.q) pixels' data from the scene memory 8 corresponding to the capacity of the one-character cut-out circuit 11 and then send the data to the one-column memory 10. The one-character cut-out circuit 11 serves to take out (m.times.n) pixels' data from the one-column memory 10 corresponding to the capacity of the character discrimination circuit 13 and then send the data to the one-character memory 12.
In FIG. 2(a), first of all, the one-column cut-out circuit 9 takes out data represented by the values of X of from l to m and the values of Y of from l to q, from the scene memory 8 and then sends the data to the one-column memory 10 (FIG. 2(b.sub.1)). The one-character cut-out circuit 11 takes out n-rows' data (represented by the values of Y of from 11 to 11+n-1) of the area including character image, judging from the contents of the one-column memory 10, and then sends the data to the one-character memory 12 (FIG. 2(c.sub.1)). When a certain character is stored in the one-character memory 12, the character is recognized by the character discrimination circuit 13. Next, data represented by the values of X of from 2 to (m+1) and the values of Y from 1 to are taken out from the scene memory 8 and then sent to the one-column memory 10 (FIG. 2(b.sub.2)). Then picture image of the area including character image is sent to the one-character memory 12. The same procedure as described above is repeated till the recognition of all characters in the range of view of the image sensor 6 is completed. In short, the recognition of all characters in the range of view of the image sensor 6 is carried out by the repetition of the procedure comprising the steps of: sending data from the scene memory 8 to the one-column memory 10 while successively shifting the position where the data are taken out; sending picture image including character image to the one-character memory 12; and processing the picture image in the character discrimination circuit 13.
The area to be sent from the one-column memory 10 to the one-character memory 12 is calculated as shown in FIG. 3. First, horizontal ORing of each row in the one-column memory 10 is carried out.
The term "horizontal OR" used herein means an operation in which the result of operation is "1" when one horizontal row has at least one black pixel, and, contrarily, the result is "0" when the row has no black pixel. If the black output of the sensor is represented by "1" and the white output thereof is represented by "0", the result of horizontal ORing is nothing but the result of ORing of all pixels in the row. For this reason, the operation is called "horizontal OR". The result of horizontal ORing only in the portion where a character exists is "black" as shown in FIG. 3(b). When, for example, the horizontal ORing becomes "black" at Y=13, n pixels from Y=11 inclusive of "white" at the upper of the character are sent from the one-column memory to the one-character memory.
By the aforementioned procedure, characters inclusive of symbols contained in the view range of the image sensor 6 can be read.
In FIG. 1 the reference numerals 14 to 18 designate means for generating the result of recognition once when one field on the subject is perfectly read. If the field is contained in the view range, character recognition can be repeated so that the result of recognition can be repeatedly generated from the character discrimination circuit 13. FIG. 4 shows the relationship between the motion of the view range and the change of the result of recognition when the scanner 1 is moved down while applied onto the field "C1234567890". In the position (a.sub.1), the corresponding recognition result (b.sub.1) is expressed as a rejection (not recognizable: represented by the symbol "?"). In the position (a.sub.2) or in the position (a.sub.3), the faithful recognition result (b.sub.2) or (b.sub.3) is obtained because all characters are contained in the view range.
The results (b.sub.1), (b.sub.2) and (b.sub.3) are generated from the character discrimination circuit 13 successively. The reference numeral 14 designates a format check portion for judging whether the recognition result obtained by the character discrimination circuit 13 satisfies a predetermined format (for example, when the field starts from the initial character "C", the initial character must be followed by ten numeral characters as data characters). A timer 15 serves to measure elapsed time after the recognition result is obtained by the character discrimination circuit 13. When the recognition result R.sub.i satisfying the predetermined format is obtained, a preceding register 16, a comparator 17 and an output control portion 18 operate as follows.
In the comparator 17, R.sub.i is compared with R.sub.i-1 stored in the preceding register 16. When R.sub.i and R.sub.i-1 lead a discord, the signal of NEW is generated from the comparator 17 so that the output control portion 18 sends R.sub.i as the recognition result R.sub.out of the field. When R.sub.i is in accord with R.sub.i-1, the signal of NEW is not generated from the comparator 17 so that the output control portion 18 does not send R.sub.i (ignores R.sub.i). On the other hand, the preceding register 16 stores R.sub.i after the preceding register 16 sends R.sub.i-1 to the comparator 17. The timer 15 measures elapsed time after the recognition result is obtained by the character discrimination circuit 13. When a predetermined time T.sub.CLR is elapsed, the contents of the preceding register 16 are deleted. The preceding register 16 is in a deleting state just after the power supply is put on. T.sub.CLR is established to be less than the time (for example, 1 second) required for the exchange of price tags. For example, T.sub.CLR is established to be about 0.6 second.
In the case where the field is contained in the view range so that the recognition result can be repeatedly obtained by the character discrimination circuit 13, the cycle of repetition is, for example, about 0.2 second.
The operation of the means 14 to 18 in the reading of a price tag is described with reference to FIGS. 4 and 5. The recognition result (b.sub.1) represented by "?" does not satisfy the predetermined format, so that nothing is sent from the format check portion 14. When the scanner is moved down to obtain the recognition result (b.sub.2) represented by "C1234567890", the format check portion 14 sends the recognition result as R.sub.i because the recognition result satisfies the predetermined format. Although the comparator 17 serves to compare R.sub.i with the contents R.sub.i-1 of the preceding register, R.sub.i and R.sub.i-1 are not the same just after the power supply is put on, because the preceding register is in a deleting state. Accordingly, the signal of NEW from the comparator 17 is sent to the output control portion 18, so that the recognition result "C1234567890" is sent out as the output R.sub.OUT form the Output control portion 18. On the other hand, the recognition result "C1234567890" is stored in the preceding register 16. Next, the recognition result (b.sub.3) represented by "C1234567890" is obtained. The recognition result (b.sub.3) is sent to the comparator 17 through the format check portion in the same manner as in the case of (b.sub.2). However, the contents R.sub.i-1 of the preceding register 16 have been changed to "C1234567890". Because R.sub.i is in accord with R.sub.i-1, the signal of NEW is not generated from the comparator and, accordingly, the recognition result is not sent out as R.sub. OUT from the output control portion 18. In short, the recognition result R.sub.OUT is sent out only once corresponding to one field entering into the view range.
The operation in the case where the scanner is moved to read multi-row fields is described with reference to FIG. 5. It is now assumed that formats of fields respectively having initial characters C, N and Y are registered in the format check portion 14. When the scanner is applied onto one row "C1234567890" of the price tag (a), the recognition result R.sub.OUT is sent out only once in the same manner as described above. When, for example, the scanner is moved down to be applied onto the next row "N1234567890", the field "N1234567890" enters into the view range. Because the contents R.sub.i-1 of the preceding register are "C1234567890" when the recognition result "N1234567890" is first obtained by the character discrimination circuit 13, the signal of NEW is generated from the comparator 17 so that the recognition result "N1234567890" can be sent out as R.sub.OUT. If the recognition result "N1234567890" is repeatedly obtained by the character discrimination circuit 13 after that, the recognition result cannot be sent out as R.sub.OUT because it is in accord with the contents of the preceding register. In short, the recognition result "N1234567890" is sent out only once. When, for example, the scanner is further moved down so that the new row "Y123456" enters into the view range, the recognition result "Y123456" is sent out as R.sub.OUT. In the case of POS price tag in accordance with JIS B9551, fields in one price tag are different from each other in their contents. Accordingly, judgment as to whether the same field is read or not can be made on the basis of comparison between the preceding recognition result R.sub.i-1 and the current recognition result R.sub.i by the comparator 17.
During the exchange of price tags from (a) to (b), no character is contained in the view range. Accordingly, in this condition, there is no output obtained from the character discrimination circuit 13. Because the timer 15 always measures elapsed time after the recognition result is sent out by the character discrimination circuit 13, the contents of the preceding register 16 are deleted if the output keeps not being obtained from the character discrimination circuit 13 for a period longer than T.sub.CLR for the reason of exchange of price tags. Accordingly, when the scanner is applied onto the field "Y123456" after the exchange to the price tag (b), the field "Y123456" can be sent out. In short, different price tags can be read continuously though the contents of fields may be the same. It is apparent from the above description that the timer 15 has the function of detecting the exchange of subjects (price tags).
In the price tag of FIG. 5(a), fields respectively having initial characters C, N and Y are written row by row.
FIG. 6(a) shows a (multi-field) price tag 40 in which a plurality of fields are written on one row. Because the plurality of fields are written on one row, the width of the row is more than the width of the view range of the image sensor though the width (number of characters) of each field is less than the width of the view range of the image sensor. However, the middle field having the initial character "N" cannot be read by the conventional optical character reader, even though the scanner in the conventional optical character reader is applied onto the middle field of "N" to attempt to read the middle field as shown in FIG. 6(b). The reason is that all characters contained in the view range 30 of the image sensor as shown in FIG. 6(b) are recognized by the character discrimination circuit 13, thus to obtain a recognition result as shown in FIG. 6(c). Because parts (c.sub.1) and (c.sub.3) of the recognition result due to fields being not perfectly contained in the view range 30 do not have correct formats, a decision of format error is made by the format check portion 14 so that a part (c.sub.2) of the recognition result cannot be sent out as the output R.sub.i from the format check portion 14.
As described above, the conventional optical character reader often could not read such a multi-field row.
In practice, some price tags to be read may be written by mistake. An example is shown in FIG. 7, in which (a) represents the correct contents to be written, and (b) represents the incorrect contents in the case where the character "S" was written by mistake for "5". According to the conventional character reader, the contents (b) can not be sent out as it is, because the contents (b) are out of accord with the predetermined format as far as character recognition is made exactly. In short, the conventional character reader cannot read the price tag (b). However, in such a case, the operator would often attempt to change variously how to apply the scanner on the price tag, while the operator does not find the price tag (b) mistaken. For example, the operator would attempt to float up or incline the scanner from the price tag. For the reason, the picture image grasped by the image sensor is often distorted, so that "S" is often misread for "5". In such a case, the price tag would be recognized as (c), so that the mistaken format became in accord with the predetermined format.
As described above, the conventional character reader often misread the miswritten price tag according to the peculiarity of the operator.